import request from '@/utils/request'

/**
 * 查询数据
 * return promise
 */
export const list = searchPage => {
  return request({
    url: '/schedule/page',
    method: 'POST',
    data: searchPage
  })
}

/**
 * 修改
 * @param {*} job
 * @returns
 */
export const modify = (data, id) => {
  return request({
    url: '/schedule/' + id,
    method: 'PUT',
    data
  })
}

/**
 * 删除
 * @param {*} ids
 */
export const deleteByIds = ids => {
  return request.delete('/schedule', ids)
}

/**
 * 删除
 * @param {*} id
 * @returns
 */
export const deleteById = id => {
  return request.delete(`/schedule/${id}`)
}

/**
 * 使用单引号需要拼接 使用 ` 可以赋值
 * @param {*} id
 * @returns
 */
export const getById = id => {
  return request({
    url: `/schedule/${id}`,
    method: 'GET'
  })
}

export const sendMsg = () => {
  return request({
    url: '/schedule/sendMsg',
    method: 'POST'
  })
}
